Skip to content

feat: add AgentCoreSessionService for AgentCore Memory - #6944

Open
a2105z wants to merge 1 commit into
google:mainfrom
a2105z:feat/agentcore-session-service
Open

feat: add AgentCoreSessionService for AgentCore Memory#6944
a2105z wants to merge 1 commit into
google:mainfrom
a2105z:feat/agentcore-session-service

Conversation

@a2105z

@a2105z a2105z commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds AgentCoreSessionService, a BaseSessionService backed by Amazon Bedrock AgentCore Memory short-term memory, so Runner(session_service=...) can persist ADK sessions there.
  • The event mapping is the one from @divakaivan's PoC (agentcore_session_service): each ADK event is one AgentCore event with a conversational payload (when there is text) plus a blob of the full ADK Event JSON, so STM extraction still works and tool calls / state / metadata round-trip.
  • Fills in the rest of the BaseSessionService contract on top of that mapping: generated session ids, AlreadyExistsError, get_session returning None when missing, list_sessions (including all users of an app), delete_session via delete_event, skip partial events, bootstrap event so empty sessions exist in AgentCore, and actorId = {app_name}:{user_id} so two ADK apps sharing a Memory resource do not collide.

Fixes #6920

Test plan

  • uv run pytest tests/unittests/integrations/agentcore/test_agentcore_session_service.py12 passed (fake bedrock-agentcore client)
    • create / get / already-exists / not-found
    • dual payload (USER + ASSISTANT conversational + blob)
    • TOOL role, partial events not written
    • GetSessionConfig filters, state_delta replay (temp: dropped)
    • list by user and by app, delete, app isolation
  • Live AgentCore Memory smoke test with AWS credentials (same shape as the PoC's agent.py)
  • CLA check

Store ADK sessions in AgentCore short-term memory using the
conversational+blob mapping from the google#6920 PoC, and implement the
rest of BaseSessionService (ids, get/list/delete, partial skip).

Fixes google#6920
@a2105z

a2105z commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Hi @wukath, @sanketpatil06, @GWeale — could I please ask for a review when you have a chance?

This is the BaseSessionService implementation for AgentCore Memory from #6920. The event mapping is @divakaivan’s (conversational text plus a full ADK event blob). I fitted that to the session-service contract and covered it with unit tests against a fake client.

Happy to change anything that does not match how you want integrations to land. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AgentCoreSessionService extending BaseSessionService for AgentCore Memory

2 participants